#!/usr/bin/env python


def aString(theParams):
	return theParams[0] + "___" + theParams[1]
	
def anArray():
	return ["hello", "there", "this", "is", "an", "array"]

def anObject():
	return [{"var1": "hello", "var2": "hi", "var3": "etc"}, {"var1": "aslkd", "var2": "asdf", "var3": "etcafgb"}]

services = {
	'aString': aString,
	'anArray': anArray,
	'anObject': anObject
}
    
if __name__ == '__main__':
    from pyamf.remoting.wsgigateway import WSGIGateway
    from wsgiref import simple_server

    gw = WSGIGateway(services)

    httpd = simple_server.WSGIServer(
        ('localhost', 8000),
        simple_server.WSGIRequestHandler,
    )

    httpd.set_app(gw)

    print "Running Hello World AMF gateway on http://localhost:8000"

    httpd.serve_forever()
